<%= form_for [:admins, @top_news], :html => { :class => "form-horizontal top_news", :multipart => true } do |f| %>

    <% if @top_news.errors.any? %>
    <div id="error_expl" class="panel panel-danger">
      <div class="panel-heading">
        <h3 class="panel-title"><%= pluralize(@top_news.errors.count, "error") %> prohibited this top_news from being saved:</h3>
      </div>
      <div class="panel-body">
        <ul>
        <% @top_news.errors.full_messages.each do |msg| %>
          <li><%= msg %></li>
        <% end %>
        </ul>
      </div>
    </div>
  <% end %>

  <div class="control-group">
    <label class="control-label" for="top_news_title">标题</label>
    <div class="controls">
      <%= f.text_field :title, :class => 'form-control' %>
    </div>
    <%= error_span(@top_news[:title]) %>
  </div>
  <div class="control-group">
    <label class="control-label" for="top_news_title">新闻链接地址</label>
    <div class="controls">
      <%= f.text_field :link_url, :class => 'form-control' %>
    </div>
    <%= error_span(@top_news[:link_url]) %>
  </div>
  <div class="control-group">
    <h3>(<%= must_label %>图片像素大小为460*350)</h3>
    <label class="control-label" for="new_medium_name">第1张图片</label>
    <div class="controls">
      <%= f.file_field :first_image %>
      <%= f.hidden_field :first_image_cache %>
    </div>
    <%= error_span(@top_news[:first_image]) %>
  </div>
  <div class="control-group">
    <label class="control-label" for="new_medium_name">第2张图片</label>
    <div class="controls">
      <%= f.file_field :second_image %>
      <%= f.hidden_field :second_image_cache %>
    </div>
    <%= error_span(@top_news[:second_image]) %>
  </div>
  <div class="control-group">
    <label class="control-label" for="top_news_name">第3张图片</label>
    <div class="controls">
      <%= f.file_field :third_image %>
      <%= f.hidden_field :third_image_cache %>
    </div>
    <%= error_span(@top_news[:third_image]) %>
  </div>
  <div class="control-group">
    <label class="control-label" for="top_news_name">第4张图片</label>
    <div class="controls">
      <%= f.file_field :fourth_image %>
      <%= f.hidden_field :fourth_image_cache %>
    </div>
    <%= error_span(@top_news[:fourth_image]) %>
  </div>
  <div class="control-group">
    <label class="control-label" for="top_news_name">第5张图片</label>
    <div class="controls">
      <%= f.file_field :fifth_image %>
      <%= f.hidden_field :fifth_image_cache %>
    </div>
    <%= error_span(@top_news[:fifth_image]) %>
  </div>
  <div class="control-group">
    <label class="control-label" for="new_medium_name">是否生效</label>
    <div class="controls">
      <%= f.select(:status, [0,1]) %>
      (0: 不生效，1:生效)
    </div>
    <%= error_span(@top_news[:status]) %>
  </div>

  <br>
  <input class="btn btn-primary" name="commit" type="submit" value="确定">
  <a class="btn btn-default" href="/admins/top_news"><span class="translation_missing" title="translation missing: zh-CN.helpers.links.cancel">取消</span></a>
  <br><br>
  
<% end %>
